# -*- coding: utf-8 -*-
# @Time    : 2024/5/16 10:43
# @Author  : Alvin
# @File    : scrapyd_job_operation.py
import requests
import os
GLOBAL_HOST = os.getenv('GLOBAL_HOST', 'localhost')

def start_scrapyd_job(data):
    response = requests.post(f"http://{GLOBAL_HOST}:6800/schedule.json", data=data)
    return response.json()
def cancel_scrapyd_job(data):
    response = requests.post(f"http://{GLOBAL_HOST}:6800/cancel.json", data=data)
    return response.json()